home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / interapplication comm / folder watching / folder watcher fba / fbalists.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  2.0 KB  |  66 lines

  1. /*
  2.     File:        FBALists.h
  3.  
  4.     Contains:    
  5.  
  6.     Written by: Greg Sutton    
  7.  
  8.     Copyright:    Copyright © 1996-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 7/21/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23.  
  24.  
  25. #pragma once
  26.  
  27. #include <Files.h>
  28.  
  29. typedef struct ItemRec                            // All linked lists have a pointer
  30. {                                                // to the next item first.
  31.     struct ItemRec*            next;                // This allows for general routines
  32. } ItemRec, *ItemPtr;                            // on linked lists.
  33.  
  34. typedef struct WatchFolderRec
  35. {
  36.     ItemPtr                    next;                // Keep a linked list
  37.  
  38.     FSSpec                    theSpec;            // FSSpec of folder
  39.     long                    theDirID;            // Actual directory ID of the folder
  40.     short                    theFileCount;        // The previous number of files
  41.  
  42. } WatchFolderRec, *WatchFolderPtr;
  43.  
  44. typedef struct WatchVolumeRec
  45. {
  46.     ItemPtr                    next;                // Keep a linked list
  47.  
  48.     short                    theVolRef;            // Volume with watch folders
  49.     unsigned long            theLastModCheck;    // Last time PBCatSearch() performed on volume
  50.  
  51. } WatchVolumeRec, *WatchVolumePtr;
  52.  
  53.  
  54. Boolean            InitWatchFolders( void );
  55. Boolean            AddFolder( FSSpec* theSpec );
  56. Boolean            AddVolume( short theVolRef );
  57. WatchFolderPtr    GetHeadFolderPtr( void );
  58. WatchVolumePtr    GetHeadVolumePtr( void );
  59. long            GetNumberOfFolders( void );
  60. long            GetNumberOfVolumes( void );
  61. WatchFolderPtr    FolderInList( FSSpec* theSpec );
  62. Boolean            VolumeAndDirIDInList( short theVolRef, long theDirID );
  63. void            FirstVolumeToLast( void );
  64. void            AddFolderPathResource( FSSpec* theSpec );
  65. OSErr            GetDirInfo( FSSpec* theSpec, CInfoPBRec* thePB);
  66.